package top.zsyle.fallback;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import top.zsyle.domain.User;
import top.zsyle.feign.UserService;
@Component
public class UserServiceFallbackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        return new UserService() {
            @Override
            public User getUserById(Long id) {
                return new User(-1L,"我是Order中的熔断哦","哒咩哒咩~~~");
            }
        };
    }
}
